﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace HeadFirest._08.Template._01
{
    public abstract class CaffeineBeverageWithHook
    {
        public void PrepareRecipe()
        {


            BoilWater();
            Brew();
            PourInCup();
            if (CustomerWantsCondiments()) 
            {
                AddCondiments();
            }

        }
        public abstract void AddCondiments();
        public abstract void Brew();

        private void PourInCup()
        {
            Console.WriteLine("倒入杯中");
        }


        private void BoilWater()
        {
            Console.WriteLine("烧水");
        }

        public virtual bool CustomerWantsCondiments() 
        {
            return true;
        }


    }
}
